#include "Menu.h"



FunctionReturn Menu::Init()
{
	//Init will initialize all values to use Main Menu info
	//                                l-x  t-y  r-x  b-y
	m_MainMenuButtons[0] = new Button(300, 400, 430, 470, UNPRESSED);
	m_MainMenuButtons[1] = new Button(600, 400, 730, 470, UNPRESSED); //etc etc also set textureIndex for each button

	m_InGameButtons[0] = new Button(50, 600, 114, 700, CARD);		//card
	m_InGameButtons[1] = new Button(250, 650, 374, 713, PRESSED);	//hammer?
	m_InGameButtons[2] = new Button(400, 650, 524, 713, PRESSED);	//item1
	m_InGameButtons[3] = new Button(550, 650, 674, 713, PRESSED);	//item2
	m_InGameButtons[4] = new Button(700, 650, 824, 713, PRESSED);	//item3
	m_InGameButtons[5] = new Button(50, 100, 174, 163, UNPRESSED);	//forfeit

	m_InGameButtons[0]->SetIfDrawing(false);
	//BaseObject();

	textureIndex = MAIN_MENU;
	//SET POSITION
	m_vPosition.x = SCREEN_WIDTH / 2;
	m_vPosition.y = SCREEN_HEIGHT / 2;
	m_vPosition.z = 0.0f;
	m_bDrawing = true;
	

	return SUCCEED;
}

FunctionReturn Menu::SwitchMenus()
{
	//Will switch to next menu depending on texture value

	//Switch to InGame
	if(textureIndex == MAIN_MENU)
	{
		textureIndex = INGAME_MENU_TEX;
		//REFORMAT BUTTONS
		m_MainMenuButtons[0]->SetIfDrawing(false);
		m_MainMenuButtons[1]->SetIfDrawing(false);

		m_InGameButtons[0]->SetIfDrawing(true);
		//SET POSITION
		return SUCCEED;
	}
	//Switch to Main Menu
	else if (textureIndex == INGAME_MENU_TEX)
	{
		textureIndex = MAIN_MENU;
		//REFORMAT BUTTONS
		//SET POSITION
		return SUCCEED;
	}

	return FAIL;
}